﻿<%@ WebHandler Language="C#" Class="AjaxPost" %>

using System;
using System.Web;
using DflyingForum.Core.Framework;

public class AjaxPost : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        Core.Web.Code.ViewManager<Core.Web.Code.UI.Controls.ChildControls.PostList> viewManager = new Core.Web.Code.ViewManager<Core.Web.Code.UI.Controls.ChildControls.PostList>();
        var control = viewManager.LoadViewControl("~/Skins/MyTheme/Controls/ChildControls/PostList.ascx");

        //control.PageIndex = Int32.Parse(context.Request.QueryString["page"]);
        //control.PageSize = 3;
        control.TopicId = Query.Request("tid", 0);//主题id
        control.ModuleId = Query.Request("mid", 0);//模块id
        control.SortBy = string.IsNullOrEmpty(Query.Request("sortBy")) ? "Sort" : Query.Request("sortBy");//排序字段
        control.SelectQuery = Query.GetSelect("select");//筛选
        control.StateId = Query.Request("sid", 0);//状态id

        context.Response.Write(viewManager.RenderView(control));
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}